#ifndef RAYTRACER_H
#define RAYTRACER_H

#include "scene_parser.h"
#include "ray.h"
#include "hit.h"
#include "material.h"
#include "group.h"
#include "light.h"

#define EPSILON 0.0001


class RayTracer
{
public:
	RayTracer(SceneParser *s, int max_bounces, float cutoff_weight, bool shadows, bool ispathtracing);
	d_Vec3f traceRay(Ray &ray, float tmin, int bounces, float weight, Hit &hit) const; 
	d_Vec3f pathTraceRay(Ray &ray, float tmin, int bounces, float weight, Hit &hit) const; 
	d_Vec3f shade(Ray &ray, Hit &hit, int bounces) const;
	
	d_Vec3f mirrorDirection(const d_Vec3f &normal, const d_Vec3f &incoming) const;
	d_Vec3f transmittedDirection(d_Vec3f normal, d_Vec3f incoming, float index_i, float index_t) const;
	SceneParser *scene;
	int max_bounces;
	float cutoff_weight;
	bool shadows;
	bool ispathtracing;
};

#endif

